package kunong.example.petpet;

import android.app.Activity;
import android.os.Bundle;
import android.view.View;
import android.widget.ArrayAdapter;
import android.widget.AdapterView;
import android.widget.Spinner;

public class Test extends Activity implements AdapterView.OnItemSelectedListener
{
	private Spinner spinner; 
	private final String[] testArray = new String[] {"Pet 1", "Pet 2", "Pet 3", "Pet 4"}; 
	
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.selectpetcharacter);
        
        setSpinner((Spinner)findViewById(R.id.spinner));
        //ArrayAdapter<?> adapter = ArrayAdapter.createFromResource(            
    	//		this, R.array.pets, android.R.layout.simple_spinner_item);
        ArrayAdapter<String> adapter = new ArrayAdapter<String>(this, android.R.layout.simple_spinner_item, testArray); 
    	adapter.setDropDownViewResource(android.R.layout.simple_spinner_dropdown_item);    
    	spinner.setAdapter(adapter);
    }

	public void setSpinner(Spinner spinner) {
		this.spinner = spinner;
	}

	public Spinner getSpinner() {
		return spinner;
	}

	@Override
	public void onItemSelected(AdapterView<?> parent, View v, int position, long id) {
		//selection.setText(WORLDCUP2010[position]);
	}

	@Override
	public void onNothingSelected(AdapterView<?> parent) {
		// TODO Auto-generated method stub
	}
}
